package com.dayu.lease.web.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dayu.lease.model.entity.UserInfo;
import com.dayu.lease.web.admin.service.UserInfoService;
import com.dayu.lease.web.admin.mapper.UserInfoMapper;
import com.dayu.lease.web.admin.vo.user.UserInfoQueryVo;
import io.micrometer.common.util.StringUtils;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
* @author liubo
* @description 针对表【user_info(用户信息表)】的数据库操作Service实现
* @createDate 2023-07-24 15:48:00
*/
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
    implements UserInfoService{
    @Resource
    private UserInfoMapper userInfoMapper;
    @Override
    public IPage<UserInfo> pageListByQueryVo(Page<UserInfo> page, UserInfoQueryVo queryVo) {
        LambdaQueryWrapper<UserInfo> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(StringUtils.isNotEmpty(queryVo.getPhone()),UserInfo::getPhone, queryVo.getPhone());
        wrapper.eq(queryVo.getStatus()!=null,UserInfo::getStatus,queryVo.getStatus());
        return userInfoMapper.selectPage(page,wrapper);
    }
}




